<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBranchesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('branches', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('自增ID');

            $table->string('name', 300)->comment('分馆名称');
            $table->string('image', 500)->comment('分馆图片');
            $table->string('business_hours', 500)->comment('开馆时间');
            $table->string('address', 500)->comment('分馆地址');
            $table->string('map', 1000)->comment('地图信息');

            $table->unsignedBigInteger('publisher_uid')->comment('发布者uid')->index();

            $table->timestamps();
            $table->softDeletes();

            $table->engine = 'InnoDB';

        });
        DB::statement("alter table `branches` comment'分馆表'");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('branches');
    }
}
